﻿<navigation:Page 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
  xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:Models="clr-namespace:DemoSimpleSilverlight.Web.Models" xmlns:Services="clr-namespace:DemoSimpleSilverlight.Web.Services" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
  x:Class="DemoSimpleSilverlight.About"
  mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"  
  Style="{StaticResource PageStyle}">

    <Grid x:Name="LayoutRoot">
        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">

            <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">

                <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
                           Text="{Binding Strings.AboutPageTitle, Source={StaticResource ApplicationResources}}"/>

                <riaControls:DomainDataSource x:Name="categoryDomainDataSource" AutoLoad="True" Height="0" LoadedData="categoryDomainDataSource_LoadedData_1" QueryName="GetCategoriesQuery" Width="0" d:DesignData="{d:DesignInstance Models:Category, CreateList=true}">
                    <riaControls:DomainDataSource.DomainContext>
                        <Services:CatalogDomainContext/>
                    </riaControls:DomainDataSource.DomainContext>
                </riaControls:DomainDataSource>
                <Grid x:Name="grid1" DataContext="{Binding Data, ElementName=categoryDomainDataSource}" HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <sdk:Label Content="Id:" Grid.Column="0" HorizontalAlignment="Left" Margin="3" Grid.Row="0" VerticalAlignment="Center"/>
                    <TextBox x:Name="idTextBox" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="3" Grid.Row="0" Text="{Binding Id, Mode=OneWay}" VerticalAlignment="Center" Width="120"/>
                    <sdk:Label Content="Name:" Grid.Column="0" HorizontalAlignment="Left" Margin="3" Grid.Row="1" VerticalAlignment="Center"/>
                    <TextBox x:Name="nameTextBox" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="3" Grid.Row="1" Text="{Binding Name, Mode=TwoWay, NotifyOnValidationError=true, TargetNullValue='', ValidatesOnExceptions=true}" VerticalAlignment="Center" Width="120"/>
                </Grid>
                <sdk:DataGrid x:Name="categoryDataGrid" AutoGenerateColumns="False" Height="200" ItemsSource="{Binding Data, ElementName=categoryDomainDataSource}" RowDetailsVisibilityMode="VisibleWhenSelected" Width="400">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn x:Name="idColumn" Binding="{Binding Id, Mode=OneWay}" Header="Id" IsReadOnly="True" Width="SizeToHeader"/>
                        <sdk:DataGridTextColumn x:Name="nameColumn" Binding="{Binding Name}" Header="Name" Width="SizeToHeader"/>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>

            </StackPanel>

        </ScrollViewer>
    </Grid>

</navigation:Page>